]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Add caps-lock Warning to the dialogs
authorUmang Jain <mailumangjain@gmail.com>
Tue, 17 Dec 2019 20:03:45 +0000 (01:33 +0530)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 17 Dec 2019 22:08:43 +0000 (23:08 +0100)
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/619

js/gdm/authPrompt.js
js/ui/components/keyring.js
js/ui/components/networkAgent.js
js/ui/components/polkitAgent.js
js/ui/shellMountOperation.js

index cb39104e140455287942c1a3862894fb319ce865..ac42c2c9604577b9f00cced83fbc7714013e6056 100644 (file)
@@ -119,6 +119,9 @@ var AuthPrompt = GObject.registerClass({
 
         this._entry.grab_key_focus();
 
+        this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+        this.add_child(this._capsLockWarningLabel);
+
         this._message = new St.Label({
             opacity: 0,
             styleClass: 'login-dialog-message',
@@ -212,6 +215,7 @@ var AuthPrompt = GObject.registerClass({
             this.replace_child(this._entry, this._textEntry);
             this._entry = this._textEntry;
         }
+        this._capsLockWarningLabel.visible = secret;
     }
 
     _onAskQuestion(verifier, serviceName, question, secret) {
index c01e09b8278026735aeac1b7c4d0a13b003ead5f..a211d002ee744258fca47b3c947f40f6ad2a972e 100644 (file)
@@ -126,6 +126,12 @@ class KeyringDialog extends ModalDialog.ModalDialog {
         this.prompt.set_password_actor(this._passwordEntry ? this._passwordEntry.clutter_text : null);
         this.prompt.set_confirm_actor(this._confirmEntry ? this._confirmEntry.clutter_text : null);
 
+        if (this._passwordEntry || this._confirmEntry) {
+            this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+            layout.attach(this._capsLockWarningLabel, 1, row, 1, 1);
+            row++;
+        }
+
         if (this.prompt.choice_visible) {
             let choice = new CheckBox.CheckBox();
             this.prompt.bind_property('choice-label', choice.getLabelActor(), 'text', GObject.BindingFlags.SYNC_CREATE);
index ab7cc88daf7dfc4e88e967f13fc1da072f591cb1..ee376326bff034841822f31dedd75487b0d2ac68 100644 (file)
@@ -101,6 +101,14 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
             pos++;
         }
 
+        if (this._content.secrets.some(s => s.password)) {
+            this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+            if (rtl)
+                layout.attach(this._capsLockWarningLabel, 0, pos, 1, 1);
+            else
+                layout.attach(this._capsLockWarningLabel, 1, pos, 1, 1);
+        }
+
         contentBox.messageBox.add(secretTable);
 
         if (flags & NM.SecretAgentGetSecretsFlags.WPS_PBC_ACTIVE) {
index e57b2cdc7f9ac73bb05288230cd682ac92a25824..f4366c2ee10c3a668624c58be4954d49877383e4 100644 (file)
@@ -109,6 +109,8 @@ var AuthenticationDialog = GObject.registerClass({
         this._passwordBox.add(this._workSpinner);
 
         this._passwordBox.hide();
+        this._capsLockWarningLabel = new ShellEntry.CapsLockWarning({ style_class: 'prompt-dialog-caps-lock-warning' });
+        content.messageBox.add(this._capsLockWarningLabel);
 
         this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
         this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
index ca06873c3e0b35bdba1046a82b20bac09f99e2af..98989ce40645ebc4bb0f4fe0440d5cc21d79e6c2 100644 (file)
@@ -368,13 +368,16 @@ var ShellMountPasswordDialog = GObject.registerClass({
             animate: true,
         });
         this._passwordEntry.secondary_icon = this._workSpinner;
+        this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
 
         if (rtl) {
             layout.attach(this._passwordEntry, 0, 1, 1, 1);
             layout.attach(this._passwordLabel, 1, 1, 1, 1);
+            layout.attach(this._capsLockWarningLabel, 0, 2, 1, 1);
         } else {
             layout.attach(this._passwordLabel, 0, 1, 1, 1);
             layout.attach(this._passwordEntry, 1, 1, 1, 1);
+            layout.attach(this._capsLockWarningLabel, 1, 2, 1, 1);
         }
 
         content.messageBox.add(grid);